<?php
function _get_citizen($p_user){
	$parameters = array('p_app_code'=>$p_user);
	$obj_client = new soapclient(_CONST_ISA_CAM_WEBSERVICE_URL);
	$str_return = $obj_client->call('get_personal_info_of_citizen', $parameters);
	if (is_null($str_return) or $str_return==""){
		return;
	}
	_xmlstring_to_array($str_return);
	return;
}

if (isset($_REQUEST['logon_citizen_id'])){
	$_SESSION['citizen_id'] = $_REQUEST['logon_citizen_id'];
	$_SESSION['citizen_username'] = $_REQUEST['logon_citizen_username'];	
}

if(isset($_SESSION['citizen_id']) && (!isset($_SESSION['arr_citizen']) || (isset($_SESSION['arr_citizen']) && sizeof($_SESSION['arr_citizen'])==0))){
		//Lay toan bo thong tin ca nhan
		$p_arr_items = array();
		$p_level1_tag_name = "citizen";
		$p_level2_tag_name_list="id,name,username,address,email,detail_info";
		$p_delimitor = ",";
		_get_citizen($_SESSION['citizen_username']);
		$_SESSION['arr_citizen'] = $p_arr_items;
		$_SESSION['citizen_name'] = _get_item_attr_by_id($_SESSION['arr_citizen'], $_SESSION['citizen_id'], 'name');
		unset($p_arr_items);
	}
?>